// console.log("你好");
// var obj = ""
// 详情页
/////////////////////////////////////////取数据
appid: ""
id: "134397"
identity: "0"
is_delete: "0"
password: "pppp"
status: "0"
token: "d8dce57a34aa72e8a1548597382d631b"
username: "chiyanfei000"
uid: '134397'
// 插入商品

$(function () {
    // axios
    //     .get('http://jx.xuzhixiang.top/ap/api/goods/goods-add.php', {
    //         params: {
    //             pimg: "images/狗粮/进口1.jpg",
    //             pname: "加拿大原装进口纽顿nutram number",
    //             pprice: "198",
    //             uid: "134397",
    //         },
    //     })
    //     .then(function (res) {
    //         console.log(res);
    //     });

    /* 查数据 */
    // axios
    //     .get("http://jx.xuzhixiang.top/ap/api/allproductlist.php", {
    //         params: {
    //             uid: 134397,
    //         },
    //     })
    //     .then(function (res) {
    //         console.log(res);
    //     });



    // let uid = location.search.split("=")[1];
    // console.log(uid)
    axios
        .get('http://jx.xuzhixiang.top/ap/api/detail.php', {
            params: {
                pimg: "images/狗粮/国产1.jpg",
                pname: "加拿大原装进口纽顿nutram number",
                pprice: "198",
                uid: "134397",
            },
        })
        .then(function (res) {
            // console.log(res.data);
            // console.log(res);
            let ores1 = res.data.data;
            // console.log(ores);
            /////////////进口
            let objbox = "";
            let ulbox1 = document.getElementById('bigbox');

            for (let i = 0; i < res.length; i++) {
                // console.log(ores[i]);
                objbox +=
                    `
            <div id="outbox">
                    <div id="midbox">
                        <img src="${res[i].pimg}" alt="" />
                        <div id="glass"></div>
                    </div>
                    <div id="big">
                        <img src="${res[i].pimg}" alt="" />
                    </div>
                <div
                    style="float: right;height: 450px;margin-left: 200px;margin-top: 50px; display: flex;flex-direction: column;justify-content: space-around;">
                    <p style=" height: 50px;font-size: 18px;line-height: 50px;"><b> ${res[i].pname}</b>
                    </p>
                    <p style="height: 50px;font-size: 34px;line-height: 50px;background: #f3f3f3;"><b
                            style="font-size: 18px;">${res[i].pprice}</b> ￥ 20.90
                    </p>
                    <p
                        style="background-color: #78b300;font-size: 20px;text-align: center; color: white; height: 56px; line-height: 56px;">
                        加入购物车
                    </p>
                </div>

            </div>
                `
                ulbox1.innerHTML = objbox;
            }
        });
})

